home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / subdIntoPolyMode.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.6 KB  |  66 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    Nov 4, 1999
  21. //
  22. //    Procedure:
  23. //        subdIntoPolyMode
  24. //
  25. //    Description:
  26. //        Given a subdivision surface (with no construction history),
  27. //      create a polygon.  For more details see the description
  28. //      with "subdiIntoPolyMode" function below.
  29. //
  30.  
  31. global proc subdIntoPolyMode( int $hookAsHistory, int $allowHistory,
  32.                               int $templateSubd )
  33. //
  34. // Description:
  35. //     If $allowHistory is set, we will try and find a polygon in the
  36. //     history of this object, delete that polygon's blind data of
  37. //     the "hierarchical edits" type and put the new blind data on
  38. //     the polygon shape.  If $allowHistory is not set, we will fail
  39. //     if the subd has history in the first place.  If there is no
  40. //     history on the subd, $allowHistory is ignored.  In that case,
  41. //     we will make a new polygon (using "point position" option and
  42. //     the base mesh on the subd -> poly conversion) and give it the blind
  43. //     data that represents the hierarchical edits.  If $hookAsHistory is
  44. //     set, we will then plug everything through polyToSubdiv node into
  45. //     the subd we started with.  Otherwise, we just leave it be.  Note
  46. //     that subd -> poly must be done without history, or we can end up
  47. //     with a loop.
  48. {
  49.     global int $gSelectSubdivSurface;
  50.  
  51.     string $list[] = `filterExpand -ex 1 -fp 1 -sm $gSelectSubdivSurface`;
  52.     int $len = size($list);
  53.  
  54.     if( 0 == $len ) {
  55.         error( "Select a subdivision surface to switch to the polygon mode" );
  56.         return;
  57.     }
  58.  
  59.     // Do each one in turn...
  60.     int $i;
  61.     for( $i=0; $i<$len; $i+=1 ) {
  62.         subdGivenIntoPolyMode( $list[$i], $hookAsHistory,
  63.                                $allowHistory, $templateSubd, 0 );
  64.     }
  65. }
  66.